﻿using ProjectFootball.MVC.Foundation;
using ProjectFootball.MVC.Foundation.ResourceLibrary;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Security.Principal;

namespace ProjectFootball.MVC.Models.EntityFramework.Entities
{
    public class TeamVersion : BaseApprovableEntity, IApprovableEntity
    {
        #region Constructors
        public TeamVersion()
        {
        }

        public TeamVersion(IPrincipal user, CreateType createType, Guid approvalGuid, Guid teamGuid, string teamName, Guid countryGuid, Guid? homeVenueGuid, DateTime activeFrom, DateTime activeTo)
            :base(user, createType, approvalGuid)
        {
            TeamGuid = teamGuid;
            TeamName = teamName;
            CountryGuid = countryGuid;
            HomeVenueGuid = homeVenueGuid;
            ActiveFrom = activeFrom;
            ActiveTo = activeTo;
        }
        #endregion

        public Guid TeamGuid { get; set; }

        [StringLength(50)]
        [Required]
        public string TeamName { get; set; }

        public Guid CountryGuid { get; set; }

        public Guid? HomeVenueGuid { get; set; }

        public DateTime ActiveFrom { get; set; }

        public DateTime ActiveTo { get; set; }

        [ForeignKey("TeamGuid")]
        public virtual Team Team { get; set; }

        [ForeignKey("CountryGuid")]
        public virtual Country Country { get; set; }

        [ForeignKey("HomeVenueGuid")]
        public virtual Venue HomeVenue { get; set; }
    }
}